import tkinter as tk

from tkinter import *

from bokeh.layouts import column

window = tk.Tk()
window.title('Calculator')
window.geometry('360x699')

#计算器的显示屏
display = Entry(window,width=10, bd=4,font=("Arial", 24),justify='right',relief=SUNKEN)
display.grid(row=0,  column=0, columnspan=6, sticky='ew',ipadx=5, ipady=80)



scientific_computing_buttons=[
    '(',')','mc','m+','m-',
    '2nd','X\u2074','X\u00B3','X\u02B8','e\u207F',
    '1/x','\u221AX','\u221BX','\u02B8\u221AX','ln',
    'X!','sin','cos','tan','e',
    'Rand','sinh','cosh','tanh','\u03C0',
    '\u232B','\u207A/\u208B','%','\u00F7','mr',
    '7','8','9','x','10\u207F',
    '4','5','6','-','log\u2081\u2080',
    '1','2','3','+','EE',
    '绘图','0','.','=','Rad'
]



s_row_value=1
s_col_value=0
for button in scientific_computing_buttons:
    button=Button(window,text=button,width=7)
    button.grid(row=s_row_value, column=s_col_value, padx=3, pady=3, ipadx=3, ipady=3)
    s_col_value+=1
    if s_col_value>4:
        s_row_value+=1
        s_col_value=0

for i in range(5):
    window.columnconfigure(i, weight=1)  # 每列权重都是1，因此它们会均匀伸展

for i in range(10):
    window.rowconfigure(i, weight=1)  # 每行权重都是1，因此它们也会均匀伸展

# n_row_value=7
# n_col_value=0
# for button1 in normal_computing_buttons:
#     button1=Button(window,text=button1,width=7)
#     button1.grid(row=n_row_value,column=n_col_value,padx=3, pady=3, ipadx=3, ipady=3)
#     n_col_value+=1
#     if n_col_value>4:
#         n_row_value+=1
#         n_col_value=0


window.mainloop()
